Skip to content

Add workflow automation for maintaining patched fork#14

Merged
adityamaru merged 9 commits intomasterfrom
workflow-automation
Nov 19, 2025
Merged

Add workflow automation for maintaining patched fork#14
adityamaru merged 9 commits intomasterfrom
workflow-automation

Conversation

@adityamaru
Copy link

@adityamaru adityamaru commented Nov 19, 2025

Summary

This PR adds GitHub Actions workflows to automate the process of maintaining a patched fork of BuildKit.

What's Included

1. Release Workflow (.github/workflows/release-patched-version.yml)

  • Manual workflow to create patched releases based on upstream BuildKit versions
  • Automatically discovers and applies all patches from our master branch
  • Builds binaries for Linux and macOS (both amd64 and arm64)
  • Creates GitHub releases with downloadable artifacts

2. Rebase Workflow (.github/workflows/rebase-upstream.yml)

  • Manual workflow to rebase our patches on upstream master
  • Helps keep our fork in sync with upstream
  • Automatically detects when patches have been merged upstream

3. Documentation (DEPLOYMENT.md)

  • Clear instructions on how to use the workflows
  • Examples for creating releases and syncing with upstream

Usage

To create a patched release:

gh workflow run release-patched-version.yml -f upstream_version=v0.17.0

To sync with upstream:

gh workflow run rebase-upstream.yml

Benefits

  • Automated patch discovery: No need to maintain patch lists manually
  • Consistent releases: All patches are automatically applied to upstream releases
  • Easy maintenance: Simple rebase workflow keeps patches organized
  • Multi-platform support: Automatic binary builds for all major platforms

Note

Adds GitHub Actions to rebase master on upstream and to create patched releases (with multi-arch binaries and checksums), plus deployment docs.

  • CI Workflows
    • /.github/workflows/rebase-upstream.yml:
      • Rebases master onto upstream/master (scheduled weekly and manual).
      • Reports patch count before/after, pushes with force-with-lease, opens issue on conflicts.
    • /.github/workflows/release-patched-version.yml:
      • Manual release with inputs upstream_version and optional release_suffix.
      • Cherry-picks patches from origin/master not in upstream/master onto the tag, tags/pushes release branch.
      • Builds binaries for linux/darwin (amd64/arm64), generates SHA256SUMS, publishes GitHub Release with artifacts and install instructions.
  • Docs
    • DEPLOYMENT.md: How to create patched releases, run rebase workflow, view patches, do manual rebase, and download binaries.

Written by Cursor Bugbot for commit 485be4f. This will update automatically on new commits. Configure here.

Removed multiple markdown files and created a single, concise DEPLOYMENT.md that explains:
- How to create patched releases
- How to sync with upstream
- The rebase workflow process

Keeping documentation minimal and focused on the essential deployment operations.
Complete redesign to use the canonical rebase workflow:
- Master = upstream + our patches (always rebased on top)
- No manual patch tracking (git knows the delta)
- Single workflow for creating releases

Key changes:
- Removed complex patch ID system and patches branch
- Added release-patched-version.yml: automatically finds and applies patches
- Added rebase-upstream.yml: keeps master rebased on upstream
- Added FORK_WORKFLOW.md: comprehensive guide for developers

Workflow:
1. Developers PR to master
2. Master stays rebased on upstream (patches on top)
3. Release workflow cherry-picks all patches onto upstream tags
4. Git automatically handles patch cleanup when merged upstream

This matches how Chromium forks, Android AOSP, and Linux distros maintain their patches - battle-tested and maintenance-free.
@adityamaru adityamaru requested a review from pbardea November 19, 2025 20:39
- Use actual newlines instead of literal \n characters
- Remove echo -e flags since we're using real newlines
- Fix tag message formatting to properly display patch list
The go build commands need the bin directory to exist before writing output files
- Use printf instead of multiline strings to avoid YAML syntax errors
- Fetch upstream master branch along with tags for patch discovery
- Fixes yamllint errors at lines 108 and 153
- Check git push failures in release workflow and exit properly
- Check git push failures in rebase workflow to avoid false success
- Prevent inconsistent state where tags exist but branches don't
- Provide clear error messages and manual recovery instructions
- Add contents: write to release workflow for git operations and releases
- Add contents: write and issues: write to rebase workflow
- Follows established pattern from buildkit.yml workflow
- Ensures workflows have necessary permissions to complete operations
@adityamaru adityamaru merged commit 75ed47a into master Nov 19, 2025
138 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant